{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 正则表达式（RegularExpression, re)\n",
    "- 是一个计算机科学的概念\n",
    "- 用于使用单个字符串来描述，匹配符合某个规则的字符串\n",
    "- 常常用来检索，替换某些模式的文本"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 正则写法\n",
    "- .(点号）：表示任意一个字符，除了\\n,比如查找所有的一个字符\n",
    "- []:匹配中括号中列举的任意字符，比如[L,Y,0]\n",
    "- \\d:任意一个数字\n",
    "- \\D:除了数字都行\n",
    "- \\s:表示空格，tab键\n",
    "- \\S:除了空白符号\n",
    "- \\w：单词字符，就是a-z,A-Z,0-9,_\n",
    "- \\W:除了上面的\n",
    "- *：表示前面内容重复零次或者多次\n",
    "- +：表示前面内容最少出现一次\n",
    "- ？：前面出现的内容零次或者一次"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Re常用函数\n",
    "- group()：获得一个或者多个分组匹配的字符串，当要获得整个匹配的字符串时，直接使用group或者group(0)\n",
    "- start：获取分组匹配的字符串在整个字符串中的起始位置，默认参数为0\n",
    "- end：获取分组匹配的字符串在整个字符串中的结束位置，默认参数为0\n",
    "- span：返回的结构技术（start(group), end(group)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
